home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / etc / init.d / killprocs < prev    next >
Encoding:
Text File  |  2006-10-06  |  944 b   |  52 lines

  1. #! /bin/sh
  2. ### BEGIN INIT INFO
  3. # Provides:          killprocs
  4. # Required-Start:    $local_fs
  5. # Required-Stop:
  6. # Default-Start:     1
  7. # Default-Stop:
  8. # Short-Description: executed by init(8) upon entering runlevel 1 (single).
  9. ### END INIT INFO
  10.  
  11. PATH=/usr/sbin:/usr/bin:/sbin:/bin
  12.  
  13. . /lib/lsb/init-functions
  14.  
  15. do_start () {
  16.     # Kill all processes.
  17.     log_action_begin_msg "Sending all processes the TERM signal"
  18.     killall5 -15
  19.     log_action_end_msg 0
  20.     sleep 5
  21.     log_action_begin_msg "Sending all processes the KILL signal"
  22.     killall5 -9
  23.     log_action_end_msg 0
  24.  
  25.     # We start update here, since we just killed it.
  26.     if [ -x /sbin/update ] && [ "$(uname -s)" = Linux ]
  27.     then
  28.         case "$(uname -r)" in
  29.           0.*|1.*|2.[0123].*)
  30.             /sbin/update
  31.             ;;
  32.         esac
  33.     fi
  34. }
  35.  
  36. case "$1" in
  37.   start)
  38.     do_start
  39.     ;;
  40.   restart|reload|force-reload)
  41.     echo "Error: argument '$1' not supported" >&2
  42.     exit 3
  43.     ;;
  44.   stop)
  45.     # No-op
  46.     ;;
  47.   *)
  48.     echo "Usage: $0 start|stop" >&2
  49.     exit 3
  50.     ;;
  51. esac
  52.